package study01;

public class Java20_menu {
    public static void main(String[] args) {
//        枚举一般使用大写的标识符
        System.out.println(City.BEIJING.name);
    }
}

//  枚举第一个参数就是方法的调用，用分号隔开，第二个参数是方法

enum City {
    BEIJING("北京", 1),
    SHANGHAI("上海", 1)
    ;
    City(String name, int code) {
        this.name = name;
        this.code = code;
    }
    public String name;
    public int code;
}

class MyCity {
    public String name;
    public int code;
    private MyCity(String name, int code) {
        this.name = name;
        this.code = code;
    }
    public static final MyCity BEIJING = new MyCity("北京", 1);
}
